package JDBCDemo1;

import JdbcConnnectionUtils.JdbcUtils;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class JDBCTest {
    public static void main(String[] args) {
        try {
            Connection conn = JdbcUtils.getConnnection();
            String sql="insert  into worker values(null,?,?)";
            PreparedStatement ps = conn.prepareStatement(sql);
             ps.setString(1,"诸葛亮");
             ps.setDouble(2,5000);
            int i = ps.executeUpdate();
            System.out.println(i);
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
